{extend name="admin@public/basic" /}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/css/admin/login.css" media="all">
<style>
    .layadmin-backlog-body p em {
        font-style: normal;
        font-size: 30px;
        font-weight: 300;
        color: #009688 !important;
    }

    .layadmin-backlog-body cite {
        padding-bottom: 10px;
        font-size: 12px;
        font-weight: 500;
        color: #333;
    }
</style>
{/block}

{block name="cotent"}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">文章统计</div>
                        <div class="layui-card-body">
                            <div id="articleCensus" style="width: 100%;height:200px"></div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">曲线图</div>
                        <div class="layui-card-body">
                            <div id="otherCensus" style="width: 100%;height:200px"></div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header">数据概览</div>
                        <div class="layui-card-body">
                            <div id="blogCensus" style="width: 100%;height:400px"></div>
                        </div>
                    </div>
                    <div class="layui-card">
                        <div class="layui-tab layui-tab-brief layadmin-latestData">
                            <ul class="layui-tab-title">
                                <li class="layui-this">今日热搜</li>
                                <li>今日热帖</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <table class="layui-table">
                                        <colgroup>
                                            <col width="80%">
                                            <col width="20%">
                                        </colgroup>
                                        <tbody>
                                        <tr>
                                            <td>文章名称</td>
                                            <td>搜索次数</td>
                                        </tr>
                                        <tr>
                                            <td>在运维管理下面，新增监管公安机构账户。 只有管理员权限才能进行查看该数据。</td>
                                            <td>535</td>
                                        </tr>
                                        <tr>
                                            <td>在运维管理下面，新增监管公安机构账户。 只有管理员权限才能进行查看该数据。</td>
                                            <td>535</td>
                                        </tr>
                                        <tr>
                                            <td>在运维管理下面，新增监管公安机构账户。 只有管理员权限才能进行查看该数据。</td>
                                            <td>535</td>
                                        </tr>
                                        <tr>
                                            <td>在运维管理下面，新增监管公安机构账户。 只有管理员权限才能进行查看该数据。</td>
                                            <td>535</td>
                                        </tr>
                                        <tr>
                                            <td>在运维管理下面，新增监管公安机构账户。 只有管理员权限才能进行查看该数据。</td>
                                            <td>535</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="layui-tab-item">
                                    <table class="layui-table">
                                        <colgroup>
                                            <col width="80%">
                                            <col width="20%">
                                        </colgroup>
                                        <tbody>
                                        <tr>
                                            <td>文章名称</td>
                                            <td>搜索次数</td>
                                        </tr>
                                        <tr>
                                            <td>可以进行服务器部署的excel表格导出。</td>
                                            <td>200</td>
                                        </tr>
                                        <tr>
                                            <td>可以进行服务器部署的excel表格导出。</td>
                                            <td>152</td>
                                        </tr>
                                        <tr>
                                            <td>可以进行服务器部署的excel表格导出。</td>
                                            <td>162</td>
                                        </tr>
                                        <tr>
                                            <td>可以进行服务器部署的excel表格导出。</td>
                                            <td>135</td>
                                        </tr>
                                        <tr>
                                            <td>可以进行服务器部署的excel表格导出。</td>
                                            <td>147</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header">代办事项</div>
                <div class="layui-card-body layui-text" style="height: 200px">
                    <div class="layui-carousel layadmin-carousel layadmin-backlog">
                        <div class="panel">
                            <ul class="layui-row layui-col-space10">
                                {foreach $quick_nav as $vo}
                                <li class="layui-col-xs4">
                                    <a href="javascript:;" data-url="{$vo.href|default=''}" class="layadmin-backlog-body">
                                        <cite>{$vo.title|default=''}</cite>
                                        <p><em>66</em></p>
                                    </a>
                                </li>
                                {/foreach}
                            </ul>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-card">
                <div class="layui-card-header">效果报告</div>
                <div class="layui-card-body layadmin-takerates">
                    <div class="layui-progress" lay-showPercent="yes">
                        <h3>转化率（日同比 28% <span class="layui-edge layui-edge-top" lay-tips="增长" lay-offset="-15"></span>）</h3>
                        <div class="layui-progress-bar" lay-percent="65%"></div>
                    </div>
                    <div class="layui-progress" lay-showPercent="yes">
                        <h3>签到率（日同比 11% <span class="layui-edge layui-edge-bottom" lay-tips="下降" lay-offset="-15"></span>）</h3>
                        <div class="layui-progress-bar" lay-percent="32%"></div>
                    </div>
                </div>
            </div>

            <div class="layui-card">
                <div class="layui-card-header">实时监控</div>
                <div class="layui-card-body layadmin-takerates">
                    <div class="layui-progress" lay-showPercent="yes">
                        <h3>CPU使用率</h3>
                        <div class="layui-progress-bar" lay-percent="58%"></div>
                    </div>
                    <div class="layui-progress" lay-showPercent="yes">
                        <h3>内存占用率</h3>
                        <div class="layui-progress-bar layui-bg-red" lay-percent="90%"></div>
                    </div>
                </div>
            </div>

            <div class="layui-card">
                <div class="layui-card-header">
                    QQ交流群
                    <i class="layui-icon layui-icon-tips" lay-tips="要支持的噢" lay-offset="5"></i>
                </div>
                <div class="layui-card-body layui-text layadmin-text" style="text-align: center">
                    <img src="__STATIC__/image/admin/qq.JPG" width="300px">
                </div>
            </div>
        </div>

    </div>
</div>
{/block}

{block name="script"}
<script type="text/javascript" src="__STATIC__/js/admin/main.js"></script>
<script type="text/javascript" src="__STATIC__/plugs/echarts/echarts.min.js"></script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var articleChart = echarts.init(document.getElementById('articleCensus'));
    var otherChart = echarts.init(document.getElementById('otherCensus'));
    var blogChart = echarts.init(document.getElementById('blogCensus'));
    $.ajax({
        url: "{:url('@admin/api.welcome/article_census')}",
        data: {},
        cache: false,
        async: true,
        type: "GET",
        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
        dataType: "json",
        success: function (result) {
            articleOption = {
                title: {
                    text: '博客文章类型统计',
                    subtext: '99PHP社区',
                    x: 'center'
                },
                tooltip: {
                    trigger: 'item',
                    formatter: "{a} <br/>{b} : {c} ({d}%)"
                },
                legend: {
                    orient: 'vertical',
                    left: 'left',
                    data: result.data.category
                },
                series: [
                    {
                        name: '访问来源',
                        type: 'pie',
                        radius: '55%',
                        center: ['50%', '60%'],
                        data: result.data.categoryData,
                        itemStyle: {
                            emphasis: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            };
            articleChart.setOption(articleOption);
        }
    });

    otherOption = {
        color: ['#3398DB'],
        tooltip: {
            trigger: 'axis',
            axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: '直接访问',
                type: 'bar',
                barWidth: '60%',
                data: [10, 52, 200, 334, 390, 330, 220]
            }
        ]
    };


    blogOption = {
        title: {
            text: '堆叠区域图'
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'cross',
                label: {
                    backgroundColor: '#6a7985'
                }
            }
        },
        legend: {
            data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                boundaryGap: false,
                data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: '邮件营销',
                type: 'line',
                stack: '总量',
                areaStyle: {},
                data: [120, 132, 101, 134, 90, 230, 210]
            },
            {
                name: '联盟广告',
                type: 'line',
                stack: '总量',
                areaStyle: {},
                data: [220, 182, 191, 234, 290, 330, 310]
            },
            {
                name: '视频广告',
                type: 'line',
                stack: '总量',
                areaStyle: {},
                data: [150, 232, 201, 154, 190, 330, 410]
            },
            {
                name: '直接访问',
                type: 'line',
                stack: '总量',
                areaStyle: {normal: {}},
                data: [320, 332, 301, 334, 390, 330, 320]
            },
            {
                name: '搜索引擎',
                type: 'line',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'top'
                    }
                },
                areaStyle: {normal: {}},
                data: [820, 932, 901, 934, 1290, 1330, 1320]
            }
        ]
    };
    otherChart.setOption(otherOption);
    blogChart.setOption(blogOption);
</script>
{/block}